improved require type detection; find package.json in parent dirs; renamed files