Changed for loop to not use for in.
see http://stackoverflow.com/questions/500504/why-is-using-for-in-with-array-iteration-such-a-bad-idea
- Fixed problem when trying to populate without loading
  - changed data.count to Object.keys(data).length
  - abstracted the populateSails code in its own function

- Improved comments in code for easier maintaining.