Validate editor preferences

This is for #7020.

I did a slight refactoring so editor prefs can be validated when ever they change. Currently only validate "tabSize" and "spaceUnits" which are numbers. All other prefs are boolean, so the only thing validation would do is to enforce default if user mucks up the prefs file.

I started a `ValidationUtils` module that might be useful in other places.