Factored settings and static bits out into separate file. Added libaddonmenu and libstub, added config UI. Removed some TODOs, and general tidies.