Determine content-type in Lua + automation familiar-changing improvements

Fixes #246