cleanup and fixes

- sql query was (probabably still is) unsafe, switched to mysqli with
prepared statement (still no input validation though)
- removed layer selection (didn't work for me)
- updated libraries
- translated variable and function names to english
- removed dead code
- removed fping status check, host status is now determined by the
availability value in the hosts table.