Added support for proxy objects, fixed failing tests, and fixed a bug when setting an associated entity to null. bugfix for #1 & #2