Allow API to take a path

Little bit of a cleaner API: you shouldn't have to parse the AST directly if all you need is passing in a path.