factor out common path in moves; QUnit tests
Merge pull request #40 from danvk/smart-rename

Factor out common path in moves and add QUnit tests