Code cleanup and fixes

Still needs some more fixes before commiting to IDPF.
Fixed config xml node order
convered space to tab
Removed comemnts, spaces. Did indention, Fixed few small stuff