added branches, more log stuff, better tests, changed the log api a bit