Moved deploy history repo code into deploy state repo