Reimplement type validator
Fix type definition errors
Update logging
Tuning things up