Unit test manager

Some unit test for the manager package. I also added several mock structs and helper functions for test purpose.
That should be good for now. Maybe have an external API we can query eventually if we think that makes sense.