Fix and add tests missing from the test plan

Some tests have not been run, as they were missing from the plan.
Adds them and fixes the ones that broke during.
Add category to some tests.
Remove unused imports.
Add license headers.