Created a few race conditions that caused more match checking than needed (sometimes resulting in newer versions being used even if an older one was available).

FTR I hate how idb forces me into callback hell.
Merge branch 'master' into appengine-proxy