fix(library/coercion): bug in coercion to function-class

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
test(lua): add coercion to function-class tests

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
test(lua): add coercion sort-class tests

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
test(lua): add coercion sort-class tests