Added tests. Fixed year parsing bug. Made API more flexible.