Address issue #240 and update a few other places

Update the import statements to be more generic, fix the incorrect import and add the on_open method to line 23 to make it more clear what is happening.