Restructure component.

[ci skip] This totally breaks everything. Local tests work but I need
to clean them up before I commit.
Add hex encoder.

Also remove old generator test.
Add methods to get/set encoder and generator instances to main class.
Add updated test cases.
Update Travis-CI config to use Composer.