Just use inspect... Fix some fairly big issues and add some tests Signed-off-by: Caleb Connolly <caleb@postmarketos.org>