Fixed memory leak in overlay library

Overlays are added to the instances array, and never removed.  This means that DOM elements would leak over time

Added necessary cleanup to the overlays `close` method

As requested, rebased onto `dev` branch