Almost periodic functions on groupoids