refactored theme delete code to doctrine2. refs #1320.
Merge pull request #1323 from rojblake/theme_fixes

refactored theme delete code to doctrine2.