fixed spelling/grammar in comments/doc
fixed grammar
Correctly inlined where suitable functions not inlined properly as reported by Tim Blechmann. Cleaned code, correctly indented, fixed headers, copyright, eliminated deprecated aliases