Refactored to follow trezor-common structures, stub of signing