Fix generators for namespaced models.
Add working test helper (borrowed from Paperclip), test for namespaced models.