cleaned up smswindow plugin
cleaned up

most SQL queries are parameterized
cleaned up more code