Working through the problems in 'Eloquent JavaScript' by Marijn Haverbeke