Improved script organization

Everything now depends on App.js, which is the main controller. All
other scripts now correctly share resources. Basically I removed some
cross-dependencies between resources.