Refactored initialisation code to a generic abstract class

The previous solution relied on a huge sequence of if statements to check for
each rule whether it was activated or not and configure it if so.

The new solution improves on that by dynamically creating and configuring any
class that implements the common generic class DiagnosticsRule. This means
that new rules will be discovered at runtime and created automatically instead
of having to remember to add the rule to the list in Program.cs.