Add unit test and remove dependency on Doctrine