Added basic date functionality, removed bad fs.exists, and cleaned up code