Add support to refresh the current repository and branch.
Add documentation and move some responsibilities.