Fixed issue with missing encodeAs methods

* Even with the loadAfter dependency, the encodeAs methods
  are missing at times when the mapper is called.
* resorted to using the JavaScriptCodec directly.