d.o #2281491, starting on dependency injection.
d.o #2281491, Now using injected entityManager
d.o #2281491, Now using injected entityManager
d.o #2281491, Refactoring on the suggestion of Dave Reid
d.o #2281491, Adding a todo