need to check for ipynb more intelligently

The `if __ipython__` check fails if you run astroquery from regular python