Move error handling to its own module
Use zepto's `empty` function to clear errors
Move view updating to its own module
Move badge update to its own module
Move lines around
Merge pull request #7 from AnyFetch/refactor

JS refactoring