Fixed problem with glob patterns mentioned in issue #31. New code uses extended version of split_prefix function to calculated all required information, and eliminates code duplication in resolve_source_to_url method.
Fixed glob patterns (issue #31)
Fix edge-case of #36, add tests.
I already had a work-in-progress patch for this, but your's is actually cleaner. Thanks!