ENH: Nest Pyglet imports for CLI use

I tried to run some analysis code that needed `read_tab` from `expyfun` form the CLI (remote SSH login), and couldn't do it because importing `pyglet.window` requires an active X server. This protects the Pyglet imports so that such code can run.

Ready for review/merge @rkmaddox.