User pages in the admin section

I've pulled out the merge of #270 so it can be merged with the newly-added tests all in one go.

@alastairs: I'd like an opinion on some of these, as a few of them feel like I'm testing just the implementation.