cleaning up some functions

removed redundant code
Fix for authorization check bug on install

Added check for missing install.php, in case data files were wiped after
install avoid confusing 404 redirect.