Change cw into a C library used by a Lua front-end.