File-object management and general refactoring.
Reference handling is taking shape