Ensure variables stay in local scope

Remove issue where `controls` and `date` were assigning global
variables.
Add .gitignore