Initial implementation of password protection
Split the big file into modules.
Fix authentication after refactoring.
Change function names