code cleanup and also added 'Save and Preview' option CRM-12965
Merge pull request #1158 from kurund/CRM-12965

code cleanup and also added 'Save and Preview' option CRM-12965