And make it more general.
Cleans up a lot of code, removes handles for now.
These are present in the netstandard branch (the rules aren't working there - probably using the wrong configuration).