Added --only and --ignore options

Also, fixed sorting order of warnings and renamed/moved some helper functions