Refactor ModUtil to Doctrine.
Backport Doctrine conversions from 2.0
Merge pull request #685 from drak/ext_d2

Convert Extensions module to Doctrine 2