Moved unit conversion logic for memory and swap from
plugin to template.

Signed-off-by: ndarshan <dnarayan@redhat.com>