Add a function could handle command. Import strncmp

In this commit, I also fix some typo and replace some hardcode
Support echo. Move delcaration of serial_ops to header file.