Large refactor to a more modular setup.
Added travis task.
Updated version to 0.4.0.