Separated core code into libned. Changed usage and instructions.