Fix a bug on multiple entry points

I'm sorry for the mess but #23 introduced a bug that bundled scripts after the first one accumulates data for former scripts. So added tests for the changes in #23.