Make the dependency on the git-plugin optional

This way the plugin does not enforce the git-plugin being installed if
users don't want to use the branch specific badges.
Remove unused imports
Improve compatibility with different Jenkins/Git plugin versions

Different setups indicate the branch slightly different, some version
prepend the remote while others don't.