Refactoring, hopefully in a coffeescript way
Better algorithm for finding the day in the week