Plan online, learn offline: Efficient learning and exploration via model-based control