Add begin/commit commands

+ fix tests