Converts ClientIdInterface to singleton

Generally singletons are bad but in this instance it simplified the code
a bit.
Small changes

Subtle changes to some random things