[flow-tool] added some more test functions
[flow] refactored & improved constant table management. Also fixes #94.