Some clean up and commenting (moved all init... to js.php)