Fix persistent vars map

The module was not clearing out the variables map between function
calls.

Would appreciate a sanity check, in case I've missed the reason why it was originally done like this.

cc @ianstormtaylor @anthonyshort