removed prototype support and fixed bug when clearOnEmpty was true and the separator wasn't the default of javascript