Bugfix: Respect JsConfig.TreatValueAsRefType<T> behavior

More information: http://stackoverflow.com/a/20344936/541420
Merge pull request #348 from mayerwin/master

Bugfix: Respect JsConfig.TreatValueAsRefType<T> behavior