Adds remainder function to lib/std.
Includes appropriate test cases.