Added S4 class branch and methods to list branches

* Added the following methods
  - branches to list branches
  - head to retrieve head
  - is.head to check if a branch is head
  - is.local to check if a branch is local