Refactored the script completely.

- Introduced a convention-based dev and feature branch detection
- Introduced checking for changes before rebasing and checking-in
- Added a new action 'mergetrunk' which merges trunk (master) into current feature branch