some refactorings in ActiveModel json serialization

All test for Active Model component passes successfully.