Changed hard coded units to a constant

*Added constants.php in configure dir
*changed all hard coded units
*some minor clean-up