Move json serializer into separate class
Added index/data convert functions for generic serializer