make JiraAgent more testable and fix some minor issues detected during testing
add RSpec tests for JiraAgent