Fix variable redeclaration; recompile JS for cookie auth. Fixes #21