Fixes to CTEProxy for Rails 4.1

Adds model name to CTEs

Fixes @(_)reflections
Merge pull request #131 from dockyard/rails4.1

Rails 4.1 compat