emulate submissions (compilation and testing)

Doesn't quite match behavior of webapp client javascript,
but it's pretty close.