Rewritten with spring python. Needs refactoring to remove MainService, but otherwise it's all DI-ed now.