Added the rest of the backend code.  Untested, but should be working.  Fixed a couple small bugs/typos.