Implemented toJSON and added tests
travisplexer: pr-454-arm travis ci test