Various cleanups, add one more error tests and remove code not needed anymore after http://bugs.dojotoolkit.org/ticket/16751 has been fixed