Implement 'switch', for moving to different heads

Fixes #1