Moved all client side logic to requirejs modules.