theme editor refactor, traversal protect

renamed some functions, added comments, cleaned up code. minor css.
Extra error checking on save fail.
Traversal protection on file save to arbitrary file.