Add UMD wrapper

Building an optimized version with r.js will failed at runtime. The UMD wrapper help fixing the issue.
By the way I've added a check because tests were failing without bower components installed.