Use builtin functions to start, end and run kbd macro.