Add first version of DB migrations (compare RoR?)
Added migrations to reduce need for postproc
Added db functions