Store local state as JSON + other fixes

Split off LuaLibrary.hs as a separate file
Simplify platform-specific code
Fix outfits datafile parsing
Fix use of # character in chat messages