refactory hierarchy and fix test bugs. refer:
https://github.com/ripple/ripple-lib-java/pull/15