Refactoring Serialization completely to move it into a new object.

Refactoring ApiResource::Base.resource_definition a bit to make it cleaner