Added DOKKU_TRACE functionality and reordered execution order to match (developers) common sense