functions.php code refactoring

Tidying code comments, marking up functions to be deprecated.