Wip 4199

Fixed how the shutdown is issued, using Sage's queue_async_signal() and threw in some miscelanea fixes on Makefile.am (missing headers) and other minor things throughout the classes (unused flags, for instance).