Changed to uni server for MySQL and tidied some js