Fixed initial error with calculations for leapyear. Contrary to what I first thought, leap years aren't just divisible
by 4. See wikipedia for calculations. Added isLeapYear procedure to test.