Implement reference score functionality, and various change to be consistent with PEP8 style guidelines. Addresses issues discussed in BMK-181 and BMK-125.