Add logout support

- Generalize remote redirect functionality into a decorator
- Clean up the URLs