Reverted last two commits, added back changes to the unit and integration tests.