update to module pattern based on https://github.com/ded/bonzo/blob/229d983c2aa567a491b5c8d5ee46bcde094a04a4/bonzo.js