handle namespaced models

- updates to allow namespaced models
- a few tweaks to maintain ruby 1.8.7 compatibility