Fixed OS detection and added some inline documentation for LuaDoc