Question 2a

2a done - moving on!
Question 2b-e

Here's question 2b-fe, omitting 2f and 2g for the moment. I have no idea
how to implement unit tests, so that'll have to wait.