Split encode and decode into individual modules

Additionally:
- Update code with current Node.js version
- Remove AMD boilerplate (still AMD module can be easily generated using dedicated tools)
Merge pull request #3 from medikoo/modularity

Split lib into function per module.