Change some javascript code to be object oriented
Edit check function to be object oriented

 with '#' will be ignored, and an empty message aborts the commit.