Reorganized script files into functional modules

See: http://cliffmeyers.com/blog/2013/4/21/code-organization-angularjs-javascript