Converting to Doctrine2, refs #17, #20