Factoring out the MNIST loader and the average darkness classifier