moved stuff in main.php

moved three DEFINE lines to beginning of main.php, so everything
currently works as before