Removing clean up stuff from functions.php and putting it in an plugin.