Sync standalone Javelin with Phabricator Javelin

Summary: We stopped submoduling this a while ago, backport some fixes into the standalone Javelin.

Test Plan: See inlines.

Reviewers: btrahan, krugerke

CC: tomo, alpjor, hedger, CatChen, aran

Differential Revision: https://secure.phabricator.com/D5564