Modernise background illumination estimation

* Function much more readable using [CyToolz syntax](http://matthewrocklin.com/blog/work/2013/11/15/Functional-Wordcount/)
* Should be faster, too.
* Add automated tests for background illumination estimates