Allow Handler classes to be inner classes (useful for tests)

Change-Id: I2a2ea0cfd1eac5e2d0b9bef1e3195574330a8f4e