Revamp parameter mapping bits
Fix test failure
Write complete test for DefaultTypeMapping class

and fix a few bugs