Convert Flow to use binary IDs (better performance and more compatible

Change-Id: I80d84a44a1b760864dcf6eefd55964f19e487c9f