CiviDiscount transformation into civix type module along with other fix

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