Better Ids, more serializable
This is slightly binary incompatible and has the following changes:
- Make sure
Id[T]
is never equal for two different instances. - Give a Long rather than Int sequence number to each Id, which is only used for toString.
- Due to the above, Dag no longer needs to know the nextId.
- add Serializable to all the types.
- improve the Literal hashCode/equals code a bit more.