More cleanup of user.js

See added comments for more information on problems discovered within the codebase.