Update mechanics.js

Simplified mechanics coding style so that finding errors and such is easier.