New functions

Added table alias, model relations and pagination.