Various tweaks in transaction handling & memoizing db functions
Don't hide period list when adding another one
Basic patch admin interface
Start implementing patch creation view (WIP)