Add compatibility with Ardent $relationsData, escape table names in subqueries

Check is_callable in addition to method_exists when checking for relationships for compatibility with Ardent's $relationsData method of specifying relationships. (fixes FrozenNode/Laravel-Administrator#748)
Escape table names in subqueries (fixes FrozenNode/Laravel-Administrator#758)