Rearrange tests
Improve rules test
add clean_intermediate_files tasks