added support for structArray and move code to src folder, closes #2