Make mirror based conversion of objects work properly

I needed working objectToJson so I did some work to get this working properly with recent Dart, all tests pass.

Daniel