Text this: Selberg's trace formula on the k-regular tree and applications