Fixing test instrumentation and data manager bug.

Should always check to see that json elements are the type that you think
before using them, or they throw nasty exceptions.
Fixing some racy conditions in Data Manager tests.

It should no longer be possible for data manager tests to get stuck (ie,
very unlikely).
Pulling out some logic from common data manager tests.
Merge pull request #153 from Mobius5150/fixtests

Fixing issues with Tests