Removed ugly static.
Added some tests.