Update LICENSE, add legal details to source, add test code, update gitignore