Add support for functionality needed by inject_i18n_strings.

Summary:
inject_i18n_strings can use our I18nExtractor instead of lxml, just
like we can, but could use a bit extra functionality to make it
easier.  No problem.  The new code is probably a bit better organized
anyway.

Test Plan: ./extract_strings_test.py

Reviewers: john

Reviewed By: john

CC: alpert

Differential Revision: http://phabricator.khanacademy.org/D2403