Move gui code out of notebook

Closes #3