Improvements

Some general improvements to function, order of operations, and the
theming system. This is just an iteration - one of those, it was 2 in
the morning so I just commited what I had - situations.