Passing the test: Improving Learning Gains by Balancing Spacing and Testing Effects