tests and slight parser refactor
Merge branch 'master' of https://github.com/mongolab/dex