Added ansilen function, which ignores escape codes

This makes anything dealing with the length of a string that might
contain ansi escape codes work properly.