Apply JUnitTest on DeadlineTask

This commit also fixes the broken, outdated, JUnitTest that was
previously using Date() object.
Apply JUnitTest on LocalStorage

While testing LocalStorage, found a few bugs that was not handled
properly.

This commit fixes some occurrences of NullPointerException, as well as
returning wrong results in LocalStorage.