General fixes, improvements and refactoring.

Also removed vert.x as a dependency.