added query param support and fixed count()

Added query params to pagination helper
Changed Model.count({where:where},...) which doesn't work to Model.count(where,...) which does.