Surrounded test-case in AnalyseImage.py with profiling code. Made lots of small optimizations to code inside loops, resulting in 10-15% performance gain on all images tested on my machine.

Added some TODO comments for optimizations which I expect to have a much bigger impact, but want Roel to look at first

IssueID #4