added signal_handler decorator
added tests and documentation