Added invert setting

And tidied up preferences