added push- and replace- state commands to manage history