Implement count function in adapter to utilize buildWhere

Implemented the count function into the mysql-adapter to take advantage of the buildWhere function that this adapter offers. Moved the buildWhere function out of .all and included a couple of parameters that were used from the scope of .all (self/model).