Implements new html contracts, and huge refactors.

Signed-off-by: crynobone <crynobone@gmail.com>