Move user check to middleware
Replaced ifs with ternary
Added branch name to travis output
Removed auth check for script retrieval, fixes #17