javascript model tests working and fixed duplicate Factory bug