Docs fixes

- Code cleanup as there was a lot of duplicate code in there
- Fixed tests
- Added tests for front-end feed

See #470 for history on this PR.