Do some code cleanup, add initial settings page