[test] Add test cases
Use easymock 2.4 instead of a custom release
Handle and test constructor relation handler
Remove dead code
Enhance test coverage and bugfix