beforeShow/onClose events not being called and tests fix

Fix: beforeShow/onClose methods was not being called. New Tests included.
Removing GMT from Date(), the test fails in some timezones