Separate main and lib config
Add error.js template

For now, this just uses `alert`.
0.6.0