CiviDiscount transformation into civix type module and other fixes

This PR also include the changes for https://github.com/dlobo/org.civicrm.module.cividiscount/pull/26 , https://github.com/dlobo/org.civicrm.module.cividiscount/pull/25 and https://github.com/dlobo/org.civicrm.module.cividiscount/pull/22