The branch refractoring

With this commit all reference to the database is removed from the branch implementation. There was some refracting doing with the fetch leaf method due to accessibility.
Or maybe even cleaner as in https://github.com/hi3g/opentsdb/pull/55/files#diff-f735ba6a5a47e3c12f8c0a433883f71fR102 ?