refactor login and enrollment test cases to use the mongo modulestore

This is the same new file as my previous PR, but this branch is more appropriately named and has a clean commit history.