Generate ledger entry indexes

Some refactoring:

- Remove duplicate functionality (several "sha512half" functions etc.)
- Split request signing functionality away from crypt.js

Plus, added some code for calculating ledger entry indexes locally. (Will be useful for contracts stuff, unit testing and eventually for proving the validity of server responses.)