Set bits per pixel correctly.
Minor cleanups.
Add some testing toys and change several methods to functions.