Mega performance improvements

This adds some massive performance improvements to noting. Theoretically, there are more exciting ways to improve performance but this will do for now.