Handle installation. Closes #1924
Use mysqli_real_escape_string instead of mysql_real_escape_string. Fixes #1926