More unit tests and added cache support.