Revert refactor

Revert the refactor (moved to [feature branch](https://github.com/stellar/stellar-lib/tree/major-refactor)).
Apply #26 and #26.