Moved tests into their own file.
Added MIT license.