Introduce task abstraction - choose tasks to run

Relevant for #10
Still work todo on abstraction of tasks. Tests bad

Working on #10, still not ok
All tests are passing in new api, see #10
Extract functions from main file.

See #10