Use rationals where convenient.

This fixes the teaspoon solving example which had failed due to floating
point error.

Test plan:
All KAS Browser Tests pass.

Auditors: alex