Fix bugs and made work with 3.x

*Added a _canPerformRefresh to track whether or not a refresh could be made.
*Removed dependency on date library