Adding tests for device contexts.

Signed-off-by: Jacob Buysse <Jacob.Buysse@gmail.com>