Code cleanup and bug fixes

addresses https://github.com/OpenBazaar/OpenBazaar/issues/282 https://github.com/OpenBazaar/OpenBazaar/issues/322 and a few similar issues
I think inline javascript should be limited to a single function call. E.g. `onclick="changeClass()"`
These 3 lines contain way too much JS.