Added basic caching, refactored some functionality, more UI things for QT, made random the default mode for now