Changed UI routing logic and created UI modules.

Moved each state into its own directory.