Added License, code documented, minor changes to API