Changed scope during serialization. Fixes #13

Hello.

This should fix the problem with scope in mutator during `toJSON()` call.
You can take a look at tests to see, how the behavior is changed.