Make integer serialisation portable.
Clean up.
Use portable integer serialisation with pattern instance references, fractions and timestamps.