Add tests for js serialization