json and test submodules, use env variable rather than changing golbals at runtime for device and pp tests
more tests. Fixes #4
Merge pull request #7 from courtf/master

Refactors. Fixes #4.