Major refactoring of signature and packet handling.