fixed bugs in synchronous code; shoved functions from validate.js to tincanValidator.js