make a copy of function into misc
remove main.h include
Merge pull request #116 from yodalee/move-misc-function-to-single-file

Move various function from main.[h,cpp] to misc.[h.cpp]