implemented configurable anon/authenticated role, removed dead code, tests passing