Basic authentication using ticket instead of username and password, fixes #7. Refactored js loading. Begin pdfjs integration as in #2

now username and password is passed in cleartext only at login, then
the a ticket valid only for the current session is passed.