add testing suite, convert to require.js structure