Added some sanity checks to prevent segmentation faults in case the functions are passed invalid pointers or uninitialized structs. Also added tests for testing the gtk window more easily.