The locking is still far from perfect and will need some cleanup but this is a step in the right direction.