Unit test manager

Some unit test for the manager package. I also added several mock structs and helper functions for test purpose.
Exactly. I tried to write a mock library for go and it turned out that [testify/mock](https://github.com/stretchr/testify) is the best we can get through Go's reflect package. There's no macro in Go so there's no way to automatically generate those boilerplate code (unless we write a preprocessor for Go.)