Added tests around plugin attempt counts, minor changes to SqlController. #17