Fix issue #330

This PR implements the changes discussed in issue #330 by combining commands such as Stage Diff Hunks and Stage Selected Lines into a single command that behaves appropriately depending on whether or not there is a selection.