Simplified code and improved docstrings
Adds a test for the fitsheader --table feature