MDL-34684 tool_health: Course categories checking refinements

Minor changes:
- Moved functions to tool_health scope
- Moved tests to tool_health scope
- Raised issue importance
- Minor coding style changes

Thanks to Marko Vidberg.