Refactor bin/shark (move main function to lib/)