Moved everything into one ons_common.php to stop duplication.