Fix settings datastructure
Rewrite plugin system & various fixes