Fixed lots of bugs with front_end.js

Front_end.js had lots of fixes.  Still heavily untested, as well as
incomplete.