Add AGPL licence headers to code to make it clear
Fix #17 - Add unit test and utf-8 encoding