Deal appropriately with query string Store URLs

Fixes #186, which pointed out that the Store plugin was only substituting
annotation IDs when the URLs contained the string '/:id', and wouldn't work
for just ':id'.