(maint) Refactor Json Remove Comment

This commit refactors the removing comment functionality by renaming the
method, removing unused variables and using some fancy build in string
methods for checking if a line starts with # or //.