Initial 1.7 commit.

Everything outside api/energy and api/block is subject to change as
everything gets updated.