Port Haskell's Bounded class

This is useful for avoiding magic numbers.
Split Bounded into lower and upper bound type classes
Merge pull request #917 from david-christiansen/bounded

Add type classes for bounded things