Bug fix: study deletion now merged to master

Refactored so that the commit and delete actions use
the same function to merge a WIP to the master if the
study has not changed along the master branch.