Adding itemfactory.js

Was not included in the original repo; found it in the online demo and
adding it.