Fix $PAGE->url warnings from CLI scripts
Remove dead $beforemod assignment

Identified by the absolutely amazing Scrutinizr