Improvements to postratings-manager.php

See individual commits, but improvements to this file, consisting of:

* Better and safer handling of input variables
* Removed some manual SQL in favour of WP's API.
* Audited the rest of the SQL to make sure it was safe.
* Removed unneeded switch() block, and decreased the line indentation for better readability :)

If you decide to merge, please test this thoroughly. It seems to be OK in my limited testing, but I have very little experience with this plugin, and how it should work. After all, you're the expert :)