Completely change the documentation: Changed to MIT license; split api into another file; fixed formatting and added many details.