Refactor tests so models are only imported once.
Adds Flask