Added migrations support; fixed JSON serializer bug