Moved pathgrid related code to components/esm/loadpgrd.[ch]pp.  Working version with debug cout.