Main function and other improvements.
Indentation fix.
Redirect and auth rules.
Merge pull request #2 from lavigor/master

Main function and other improvements.