Major refactoring to support transitions and new variable / theme system