Day 6 - Mainly code reorganisation

Not much new stuff learnt or code done - but much closer to having a
good semaphore structure which can go into a permanent home somewhere
and be worked on from there