Completely rewritten.
Library target is a separate project now.
Added LICENSE file