Extracted some function for mage_* scripts.

Added mage_module to create basic files for magento modules.