Added disk caching and split command-line tool from
library. Not in working shape yet.