dispose methods added

created dispose/cleanup methods to remove event listeners and close all
connections