Added lots of code for persisting stuff to datomic.