Added datepicker widget. Tidy up code.

Added the Pikaday date picker widget.
Tidied up some code and added some comments.