Implemented XDate JS library

Eliminated redundancies and refactored to use XDate library