style cleanup + switched most remaining write queries to prepared statements

1 `act` file does not use prepared statements, do it later