Added Mage::getBlockSingleton() and Mage::getResourceHelper() support, class rewrites support, fixed some bugs

- added Mage::getBlockSingleton() support
- added Mage::getResourceHelper() support
- added class rewrites support
- fixed mappings generation for invalid class names