Implement revert and use it to improve reset. Closes #8