implement get_required_files

Summary: It is just a clone of `get_included_files`.

Reviewed By: @JoelMarcey

Differential Revision: D1408381