Added memory profiling functionality.  Reduced memory footprint of several demand model components.