Fix up the libRocket implementation so that it doesn't crash when drawing non-textured surfaces
Move the UI stuff into core