Only set the 'valueAsNumber' property is the value is valid
Map browser event handler refactoring

This commit refactors the code of the map browser event handler. The changes are the following:

Previously the `handleTouch*_` listener functions handled both `touch*` and `mspointer*` events. With this commit we use per-event type listeners. This duplicates some code (could be avoidable), but makes it easier to introduce mouse/touch/pointer specific treatments in the future.

We now listen to pointermove, pointerup, touchmove and touchend only when needed. In this way we're assured that a `down` event was received (and that `this.down_` is set) when the `up` or `move` listeners are called. This fixes the bug @oterral reported on the mailing list: https://groups.google.com/d/msg/ol3-dev/jR844F7Nlg8/eN9dt4uATK0J.

To avoid problems in browsers that trigger different types of events (e.g. both mouse and pointer events) the `down` listeners unregister the other `down` listeners. For example, the `pointerdown` listener unregisters the `mousedown` and `touchstart` listeners, for ever.
Give interactions a reference to the map

This is in line with what we do for controls and overlays.  A follow-up change will add calls to `setMap` when interactions are added to a map.
Add addInteraction and removeInteraction methods to the map

This is in line with how we add/remove controls and overlays.
Merge pull request #1186 from fredj/validate_valueAsNumber

mouse-position example: Projection select issue
Merge pull request #1203 from elemoine/touch

Map browser event handler refactoring
Add support for passing interactions as an array for consistency.
Merge pull request #1210 from pagameba/mapoptions-interactions

Add support for passing interactions as an array for consistency.
Fix precision input change in mouse-position example
Allow interactions to deal directly with browser events

The relayEvent_ method wraps goog's browser events in our MapBrowserEvent.  This allows interactions to deal with real browser events in addition to our emulated events.
Merge pull request #1211 from tschaub/relay

Allow interactions to deal directly with browser events.
Merge pull request #1173 from tschaub/map-interaction

Give interactions a reference to their map.
Correct docs for map.getTarget
Merge pull request #1215 from probins/target

Correct docs for map.getTarget
Merge pull request #1193 from fredj/mouseposition_precision_input

MousePosition example issues
Make ol.Object#getKeys about 10x faster
Moving squaredDistanceToSegment to the coordinate package
Merge pull request #1224 from twpayne/faster-object-getkeys

Make ol.Object#getKeys about 10x faster
Let closestOnSegment return nothing more than a coordinate

Since we do not use the 'along' property anywhere, and the
resulting array returned by closestOnSegment could cause trouble
when working with 3d coodinates, now only the closest point is
returned, and the squared distance to the segment is calculated
by squaredDistanceToSegment instead.
Function to buffer an extent