Add caching, some documentation.