created type context, fixed remaining style errors, fixed most tests