Added spring beans. Refactored tests.