Changed to MIT license. Added a few helper functions.