WIP: (Mostly) working polling directive

Example implementation on city/region upload page

This is here to get some initial feedback on implementation, thoughts on ways to improve before I finish this up and implement it on the other pages tomorrow. Please comment!
This looks good - I think my only suggestion would be to add docstrings to some of the functions because they have side-effects and since this is meant to be used generally, having those docstrings make its use/extension later easier.