Move files to src/{query,external}
Add scheduler and real_scheduler

These are the first steps to be able to mock timers in an easy way
for testing purposes.