Id type 2

addresses #276 

Tested on Sqlite. There is still an error on re-serialization, but I am not familiar enough with the Sqlite code to track down where that is occurring. @snoyberg not urgent, I probably won't be looking at this again until next weekend, but can you run the tests against Sqlite and point me to where the error is occurring?