Added code to clean up resources

- Map now releases it's references to textures
- Added function to Window to prune unused textures