I would have to do some testing regarding the cyrillic problem, but as for your database query using Joomla coding standards, it will look like this:
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select($db->quoteName(array('oldword', 'newword')))
->from($db->quoteName('#__words'));
$db->setQuery($query);
$results = $db->loadAssocList();
$find = array();
$replace = array();
foreach ( $results as $row ) {
$find[] = $row->oldword;
$replace[] = $row->newword;
}
$oldstring = 'Some text';
$newstring = str_replace($find, $replace, $oldstring);
echo $newstring;