Added some more docs and refactored the calendar.js code a bit re #95