I moved all of the frontend code into its own package

I finnally teased out all of the frontend's dependencies on the main
package. I also moved all of the code that belongs to the frontend into
the frontend package.