fix some test peculiarities

mostly fixed strange json behavior
because tests run python code from strings pyflakes was not detecting proper import usage
Merge pull request #126 from pkit/tests_fix

fix some test peculiarities