Fixing non-obvious TypeInfo behaviour

Unit tests to show broken behaviour.
Original unit tests had config on the wrong object, so looked like the worked, but did not reflect reality.
Fixing non-obvious TypeInfo behaviour

Fix mishandling of TypeInfo config on serialization which caused it to be lost.
Merge remote-tracking branch 'origin/master'
Merge pull request #31 from JonathanO/master

Fix for issue #28 : TypeInfo mishandling