Make this script more module and pylint complient

  * Add logger
  * Add argparser
  * Move function into a class