Support for 5 param signature in levenshtein

This fixes issue #166
The implementation is direct port of PHP's source code (except for param handling)