Major refactoring and improvements to the context switch implementation and how contexts store their confidence values. I hope the code will be more readable and ready to future improvements. Feedback is very welcome, as usual.