[#1809] Add patch for javaflow
* some code cleanup
[#1831] Fix loading modules for avoiding circular loading