Add patch to remove any stupid leading BOM
Use existing set_table_keys
Fix handling of chunks to be more like in Lua

While load/loadfile now handle states they don't actually modify, this
change is just for forwards compatibility. Also cleaned up internal
interface in compiler.