[tests] refactor interface_rest.py to avoid code repetition
[tests] refactor interface_rest.py to avoid code repetition

Also refactor txout index parsing and formatting.

chaincoin/chaincoin,chaincoin/chaincoin,chaincoin/chaincoin,chaincoin/chaincoin,chaincoin/chaincoin,chaincoin/chaincoin