Add preferences dialog

(most settings are working except dark style and a few build & run options)