Add another source file, will need more unit work
Put globals inside the library

So much for thread safety...
Merge remote-tracking branch 'origin/master'