enhance analyser functionality

* factor code into separate files
* read from database and write to Redis