Adding many changes described in the prior commit.