Class for working with rational numbers