Added last, and lastKey methods to Model.class
Fixed a query where a parameter wasn't put into bind array
added the direction to orderby option on search function