Avoid augmenting passed-in state objects when creating Context instances

The Context constructor currently adds a path property to passed-in state objects. This is dangerous if the user has any further use for the passed-in object. Creating a shallow copy of the state object before assigning it to the Context instance solves this problem.