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
No, you don't actually want a blank line, but a trailing newline. Which implies a blank line I guess... But the point is, GitHub detects that and (a) shows nothing when the trailing newline is there, and (b) shows a red "carriage return" arrow at the end of the line when it's missing. (See your own PR.)