renamed types to type, and added an exception package

Signed-off-by: Alexander Skjolden <alex@plastboks.net>