Extracted FormFactor provider code

@Pacane This should make it easier to unit test form factor detection.

formFactor.js: `findFormFactorFromQuery()` / `findFormFactorFromUserAgent()`.