Made `Agent` an abstract class, pushed existing implementation into a private `SecretAgent` class and added a java-lovin' factory method. See #3108