Assigned and populated relation and arel_table variables

When attempting to `touch` and object using the 4.1.x branch, an exception is thrown stating that the variable or method `relation` cannot be found.

The `4.0.x` branch has the `relation` and `arel_table` variables set which avoids this issue, however they are not included in the `4.1.x` branch. This pull request re-introduces them, solving the issue.

This is a fix for #198

Also adds a fix for the `attribute_names` method returning the compound key. This causes `to_json`, `as_json` and `serializable_hash` to break when trying to convert the compound key class into a string.