Add filename parameter

Need `filename` to be passed in to make includes work. Added corresponding tests.
PTAL @eleith @jnwng