always look on the bright side of life

lots of little fixes and code shifts. references aren't working entirely
right yet but most everything else seems to work.