Refactor tests

Test are refactored to separate functionality and to enable reuse in users of the provider.
Wait, I thought we were pushing all of this LMS specific stuff into the LMS...