fixed an error in vectorizer, added tests for vectorized output

I had trouble getting jslint working with my editor. I think it more or less matches your existing style though.