Moved imports outside __init__. This fixes #34. Added fake cache object in the case where cache is not configured. Modified compile_regex to be more general and correctly translate from wildcard query to regex pattern. Modified get_branches algorithm to be more efficient, using more efficient compiled regex for big speedup in branch finding and lower memory use.