Update control.php

Overhaul, better handling for ajax requests from the front-page. Beginning of dimmer-support.