Mostly finished fopen. Had a few datastructure fixes.