Fix signing/serializing mistakes, and add appropriate tests.
Fix signing, was using wrong data.
Make rsign output more similar to rsign.js.
Add two more tests for signature verification.