Tidy up and finish implementation of signature and timestamp