Added tests and increased performance of graph creation

Database operations were markes as @Transactional instead of service
methods. By fixing this, the performance of database creation increased.

Configured JUnit with Spring and commited tests.