I've made a gist[0]; feel free to get in touch via GH if you'd like to discuss it further.
[0] - https://gist.github.com/marklr/ae0c2f1eb61855d13cde6cef6bf63...