Rewrote convert.convert() to be faster and simpler.