Add variable manager and fix some unicode errors for R backend

Authored by sirgienko on Jul 4 2018, 8:15 PM.