refactored routing and authentication script

refactored for readability and cleanliness -> removed comment clutter
and introduced more appropriate, method-level comments instead in
addition to changing some pseudo-hard-coded redirects into less(read no)
maintenance-required redirects