Moved some stuff from tutorial playground into glucose application.