check for undefined value for piecework and piecework.model. also call processMetadata in processData. add an 'initialized' flag