Fixed a bug that would cause custom model object to not be used when doing a manyMany relationship.
Added a view::debug method to help with checking php variables.