Fixed weird error where JavaScript wouldn't send onlinePlayers.php?function=load by changing 'load' to 'getList'
Fixed chat.php error caused by weird SQL query

- Also misc. refactoring