WIP: Combined Login/Registration: Set up basic enrollment infrastructure.

Any variables should be declared at the top of the function to prevent hoisting (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var)