Separate method for clean filename and mode, for backward compatibility

Also renamed $obj to $self for consistency