Moves many helper functions from views.py to helpers.py.
Rewrites get_or_create() code to be more clear.