Treat year and month as integers

Script was treating integers as strings containing integers and doing
all sorts of unnecessary record keeping gymnastics.
Validate months better