Prefixed all JS functions with fn

Prefixed all JS functions with fn - as per convention.