1. Refactored javascript variables and functions.
2. Added logout feature.
Added activity saving constraints.