Initial work on GUI + some core changes

This is what I've managed to do today, read the commit descriptions for details.