Clean up DesignScript resource when shutting down

Add Dispose() method to some classes, clean up resources when shutting down.