Adds sorting and tests to context
Changes a test, prob should do a better check...