Added ability to edit templates on mobile devices.  Updated primary keys for some tables.