Move the input mapping logic to the InputDeviceMapping class

Also add a mapping pointer on the InputDevice class representing the
current mapping.
Fix travis-ci build

This code wasn't meant to be committed this early