added configurable timeout to is_alive(). shuffled some exceptions around