Updated for lens >= 4.0.7

Updated for the latest version of lens.

I've haven't tested this in any way (apart from compiling it - so it's 99% perfect) and I've introduced FlexibleContexts (which I'm unsure of the implications for). I'll update as I start to play with it and run into any problems.