Fixed a bug with serializable and inheritance
Mayor refactoring of flatten. Now super clean
Cleaned the validation a little bit and made sure that ValidationError doesn't contain nested ValidationErrors, but only primitive types