Adding some clean object utilities

This is needed to remove HibernateProxy from objects before serializing
to json.