Re-created the init command for the rewrite

Functionally much as before, but rewritten.