serialize: include non-zero milliseconds for Date
serialize: don't forget plain Error
test: add serialization tests