Fix the widget creation script to respect directory structure

The widget creation script now uses the -r flag and removes
all temporary files

Jira issue: APPPR-17