Add rewritten version

Add the main code, update the README, add the LICENSE