Worklist -> database

Read up on relationships in database tables and implemented worklists
as a many-to-many relationship between users and templates.  This has
been refactored and replaces the old Sessions-based implementation of
worklists.  This has been tested and should be merged back into the
main branch soon.