Added general docu, license, etc.  Added some type checking.