Bug fix and jshint improvements in styletopleft

Primarily to fix the accidental creation of a global variable 'p' in the 'for' loop. A better approach anyway is to use prototypical inheritance to avoid modifying the original object, rather than taking a deep copy.

Jshint's suggestions for the file have also been acted upon.