move and rename some core couchforms functions
fix an annoying abstraction violation in uth

this also wasn't using locking correctly: it never released the locks
Merge branch 'fix-uth' into explicit_case_processing