Add .gitignore.
Avoid Eclipse bug by changing inclusion order for getopt.h and unistd.h.
Add some simplified functions to facilitate API understanding.