Upgrade flow.js

Close #16 and #6.