Configurable first day of the week

Added support for an optional attribute: first-day.
Some refactoring of the code that fills the dates array.
Updated the tests.