Clean up and refactoring.

Refactored to use restful routes and Rails conventions.
Deleted unnecessary files.