Add maxRetries option (#20)

Added job retry limit proposed in #20, tests included.