Added simulation mode for signing.

- Also modernized structure.
- Fixed RST.