Code refactorings to accomodate typescript's --no-implicit-any option

Note, chai's definitions were updated from DefinitelyTyped