Removes duplicate code and flattens the structure

- Removes duplicate code (A lot of the code had been written twice: once for creating a new poll and second time for editing an existing one)
- Flattens the structure (nested ```if () {``` clauses make the code difficult to read)
- Removes some unnecessary code
- Fixes a bug where user was able to edit a site-wide poll even if admin had disallowed site-wide polls