refactor the most important function to libtelxcc.h
seperated some global variables from their struct definitions
seperated more global variables from their struct definitions
group struct definitions together, and global variables together