Various code improvements, updated readme