This commit is doing a general refactoring of the current code base and it also integrates the new plugin lib.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>