Implemented XDate JS library

Eliminated redundancies and refactored to use XDate library
Merge branch 'master' into doc