Initial commit. Will clean up and do some refactoring in the code.
One of many refactorings.