Fixes #104 Objects as custom encoders

This PR checks if a encoder implementation is a object and if so returns it. Fixes #104

Note:
 - We do assume that Objects always end on $ and classes never do. 

Todo
  [ ] Test cases for custom encoders