Implemented default prefix and domain that can be set in configuration.

Signed-off-by: Jason Lewis <jason.lewis1991@gmail.com>
Lots of refactoring and cleaning up.

Signed-off-by: Jason Lewis <jason.lewis1991@gmail.com>