Move writebody function and other misc changes

Moved the writebody function to one location so that the global
variables only needed to be added once. Also removed unneeded files and
added topuser to tiles theme.