Use luachheck to remove code that is no longer used
Type checking will be performed in unit tests, but will be an empty function at runtime.
Add a check_types method that can check lua types for correctness.