Added option to center windows. Exported function to Lua.