Merge pull request #199 from johannhof/master

Closes #199 Replace xml-escape r=@erikvold
Move profile creation into lib/profile (fix #187)