Port of the generic Lua libraries from ConTeXt.