Add an example for user agent detection.
Use ternary operators to reduce code size for user agent detection.
Merge to a single function for user agent name and major version detection.
Update index.html.