Refactored directive to use angular element and completed directive tests

Signed-off-by: Simon Bailey <simon@newtriks.com>