[Processing] Adds a file type detector.

This way we can route files and process them correctly.
Also adds tests for this.