Refactor and improve week_string() routine

Also fixes a bug where saturdays/sundays are miscalculated sometimes.