Restructuring the core. The gui is good to go.

Signed-off-by: Patrick Meppe <tapmeppe@gmail.com>