Add back CommonLogger middleware

This is probably temporary until work is done #34
Extract variables out into private methods