Improve type id (tag) handling; expose tags for scalars too, not just objects
Improve testing to verify that #21 works as expected