Move idle calculation into lib, wip
Merge branch 'master' into builds
7.884