Update raw queries to support Versioned if appropriate

Please give this a look over, I was only able to test saveGridRows() so far.