More refactoring.
1- moved class 'lsproblem' to a separate file
2- changing some names and indentation to follow PEP8 standard (not completed)