Added Factory, improved tests. Fixed run to keep looping.