Must initialise $PAGE before creating a form object.

Otherwise it broke in Bootstrap-based themes.