Refactored code to be much cleaner, made README a markdown file.