more work on modulerizing the code... still hate CJS and RequireJS...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>