Replace named functions with anonymous functions

Functions in index.js were unnecessarily occupying the global
namespace. Using anonymous functions to remove them.
Fixes #69