Refactor library to use new Buffer wrapper.
Add HandlerFactory utility class for creating common handlers.