Restructuring, small fixes, cleanup of wc.db rip.