Move utility functions to utils.py and make tests pass.
Fix bug 1047002: Do not generate token in subscribe view.

Includes rewritten tests for the view and utility function.
Merge pull request #107 from Osmose/async-subscribe

Fix bug 1047002: Async subscribe