Licensing and flag additions

See git log for full details.