add node and edge attributes and some refactorings
add '--mode' option to switch running mode: data collection mode or data analysis mode