fix #367 -- discovery/store race condition
whitespace
use simplejson if possible
stop trying to be too smart with dict resource

I screwed up login ajax. My bad.