checking in work in progress. includes most if not all db changes. needs testing etc.