New directory structure

Added 'external' to hold required node modules. Put all the original
libs code into 'common'.