Semi-final commit

Finished the local_map mapping ofcoins. Also added comments to all main
files.