Precompute OS name and type.

These methods will be called frequently, so it is better to compute the
result once and cache it than to recompute it each time it is requested.