Surgery room 4

Massive overhaul of db-related functionality of the surgery room pages.