Mastering Impulse Control