tweaks for json
reworked to src, added tests, added travis