Refactored get_set_weighted_kanjis to use PDO.
Refactored additional functions to use PDO. Source formatting and cleanup.