Start of v2 handler

Formatted some files.
Fixed a bug.
Added more util methods.